// 公共指令
import Vue from 'vue'

// 格式化日期
Vue.filter('formatDate', val => {
  let date = new Date(val)
  let y = date.getFullYear()
  let m = date.getMonth() + 1
  let d = date.getDate()
  if (m < 10) {
    m = '0' + m
  }
  if (d < 10) {
    d = '0' + d
  }
  let t =y + '年' + m + '月' + d + '日'
  return t
});
